package flst.ipiweb.statistics;

import java.io.Serializable;
import java.sql.Date;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;

/*import org.jfree.chart.labels.CategoryToolTipGenerator;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;

import de.laures.cewolf.DatasetProduceException;
import de.laures.cewolf.DatasetProducer;
import de.laures.cewolf.links.CategoryItemLinkGenerator;
import flst.ipiweb.service.ServiceCommande;

public class StatsData implements DatasetProducer, CategoryToolTipGenerator, CategoryItemLinkGenerator, Serializable {

	@Override
	public String generateLink(Object arg0, int arg1, Object arg2) {
		return "StatsData";
	}

	@Override
	public String generateToolTip(CategoryDataset arg0, int arg1, int arg2) {
		return "StatsData";
	}

	@Override
	public String getProducerId() {
		// TODO Auto-generated method stub
		return "StatsData";
	}

	@Override
	public Object produceDataset(Map arg0) throws DatasetProduceException {

		DefaultCategoryDataset dataset = new DefaultCategoryDataset();

		List<Date> dateList = new ArrayList<Date>();

		Calendar c = Calendar.getInstance();
		c.add(Calendar.DAY_OF_MONTH, -7);

		for (int i = 0; i < 7; i++) {
			Date d = new Date(c.getTimeInMillis());
			dateList.add(d);
			c.add(Calendar.DAY_OF_MONTH, 1);
		}

		ServiceCommande sc = new ServiceCommande();
		List<Integer> valuesList = sc.getNumberOfCommand((Date[]) (dateList.toArray()));

		for (int i = 0; i < dateList.size(); i++) {
			dataset.addValue(valuesList.get(i), "VALUES", dateList.get(i));
		}

		return dataset;
	}

	@Override
	public boolean hasExpired(Map arg0, java.util.Date arg1) {
		// TODO Auto-generated method stub
		return false;
	}

}*/
